Skip to content

feat(orch): add observability for build cache#2279

Merged
jakubno merged 2 commits intomainfrom
observability-measure-how-long-are-data-kept-in-cache-eng-3727
Apr 19, 2026
Merged

feat(orch): add observability for build cache#2279
jakubno merged 2 commits intomainfrom
observability-measure-how-long-are-data-kept-in-cache-eng-3727

Conversation

@jakubno
Copy link
Copy Markdown
Member

@jakubno jakubno commented Apr 1, 2026

Adds a histogram for duration how long the builds stays in cache

@linear
Copy link
Copy Markdown

linear Bot commented Apr 1, 2026

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 1, 2026

PR Summary

Low Risk
Low risk: adds metrics instrumentation and a small in-memory timestamp map, without changing cache eviction or diff cleanup behavior. Main concern is minor additional memory/CPU overhead and potential skew if items are overwritten without updating the original insert time.

Overview
Adds OpenTelemetry instrumentation to record a histogram (orchestrator.build.cache.residence_duration) for how long a cached build diff remains in the local build cache, tracking insertion time per diff key and recording the duration on cache eviction.

Reviewed by Cursor Bugbot for commit e889caf. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread packages/orchestrator/pkg/sandbox/build/cache.go
Comment thread packages/orchestrator/pkg/sandbox/build/cache.go Outdated
Comment thread packages/orchestrator/pkg/sandbox/build/cache.go
Comment thread packages/orchestrator/pkg/sandbox/build/cache.go
Copy link
Copy Markdown
Contributor

@arkamar arkamar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jakubno jakubno merged commit b711a89 into main Apr 19, 2026
45 checks passed
@jakubno jakubno deleted the observability-measure-how-long-are-data-kept-in-cache-eng-3727 branch April 19, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants